<?php
/*=============================================================================
#     FileName: ajaxcheckAction.class.php
#         Desc:
#   LastChange: 2017-09-29 17:30:54
#      Paramer:
=============================================================================*/

class ajaxcheckAction extends FrontAction {

    private $_ftxconfig = null;
    public function _initialize() {
        parent::_initialize();
        $this->_mod = D('items');

        if(C('ftx_site_cache')){
            $file = 'items_site';
            if(false === $this->_ftxconfig = S($file)){
                $api_config = M('items_site')->where(array('code' => 'ftxia'))->getField('config');
                $this->_ftxconfig = unserialize($api_config);
                S($file,$this->_ftxconfig);
            }
        }else{
            $api_config = M('items_site')->where(array('code' => 'ftxia'))->getField('config');
            $this->_ftxconfig = unserialize($api_config);
        }
    }

	public function check_regcode(){
		$regcode        = I('regcode');

        //$map = array(
        //    'regcode' => $regcode
        //);
        if (regularCheck('regcode', $regcode)) {
            $map = "regcode='$regcode'";
        }else{
            $map = "username='$regcode'";
        }
		$result = M('user')->where($map)->find();

         if(!$result){
				exit('false');
		 }else{
				exit('true');
		 }
	}
}
